package org.agile4j.easypoi.entity;

import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;

import java.util.List;

/**
 * Created by Administrator on 2016/7/19.
 */
public class Item2Entity {

    @Excel(name = "id" )
    private String id;
    @Excel(name = "描述")
    private String desc ;

    @ExcelCollection(id = "trace", name = "交易")
    private List<TraceEntity> traceList ;

    @ExcelCollection(id = "item3", name = "三级目录")
    private List<Item3Entity> item3List ;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public List<TraceEntity> getTraceList() {
        return traceList;
    }

    public void setTraceList(List<TraceEntity> traceList) {
        this.traceList = traceList;
    }

    public List<Item3Entity> getItem3List() {
        return item3List;
    }

    public void setItem3List(List<Item3Entity> item3List) {
        this.item3List = item3List;
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this) ;
    }

    @Override
    public boolean equals(Object other) {
        if(this == other){
            return true;
        }

        if(other == null){
            return false;
        }

        if( !(other instanceof Item2Entity)){
            return false;
        }

        final Item2Entity item2Entity = (Item2Entity)other;
        if( !getId().equals(item2Entity.getId())){
            return false;
        }

        return true;
    }
}
